fix: remove dead --agents flag from add gateway#711
Merged
jesseturner21 merged 1 commit intoaws:mainfrom Mar 27, 2026
Merged
Conversation
The --agents CLI option was registered on the `add gateway` command but never wired into the gateway creation logic. buildGatewayConfig() never read options.agents, validateAddGatewayOptions() never validated it, and AddGatewayConfig had no agents field. A user passing --agents would have their input silently discarded. Remove the flag from CLI registration, type definitions, action handler passthrough, and documentation. Add a regression test confirming the flag is now properly rejected. Constraint: Current architecture wires all gateways to all agents via wireGatewayUrlsToAgents Rejected: Deprecation warning cycle | zero known consumers, flag was never functional Confidence: high Scope-risk: narrow
Contributor
Package Tarballaws-agentcore-0.3.0-preview.9.0.tgz How to installnpm install https://github.com/aws/agentcore-cli/releases/download/pr-711-tarball/aws-agentcore-0.3.0-preview.9.0.tgz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Remove the dead
--agentsCLI flag fromagentcore add gateway. The flag was registered on the Commander command, included in type definitions, and passed through the action handler, but was never consumed bybuildGatewayConfig(), never validated byvalidateAddGatewayOptions(), and theAddGatewayConfigtype had noagentsfield. A user passing--agents my-agent1,my-agent2would have their input silently discarded.This was a leftover from an earlier design where gateways were associated with specific agents. The current architecture wires all gateways to all agents via
wireGatewayUrlsToAgents()in the CDK constructs — there is no per-gateway agent association.Changes:
--agentsoption registration from Commander (GatewayPrimitive.ts)agents?: stringfrom bothAddGatewayOptionsinterfaces (primitive + CLI types)agents: cliOptions.agentspassthrough in the action handler--agentsdocumentation row fromcommands.md--agentsis now properly rejectedRelated Issue
N/A — dead code cleanup discovered during code review
Documentation PR
N/A — only removed a doc row for a non-functional flag
Type of Change
Testing
How have you tested the change?
npm run test:unitandnpm run test:integnpm run typechecknpm run lintsrc/assets/, I rannpm run test:update-snapshotsand committed the updated snapshotsTest results: 216/218 test files pass. 2 pre-existing failures in
tui-harness/__tests__/proof-of-concept.test.ts(PTY/xterm wiring — unrelated). All 9 gateway-specific tests pass including the new regression guard.Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.